test: 新增 Session/Memory/Summary 回放一致性测试框架#115
Open
xyxhhhhh wants to merge 1 commit into
Open
Conversation
f7c2d6c to
0e8ef83
Compare
0e8ef83 to
bc6e1d0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
==========================================
Coverage ? 87.53096%
==========================================
Files ? 467
Lines ? 44005
Branches ? 0
==========================================
Hits ? 38518
Misses ? 5487
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
Closes #89
为 Session / Memory / Summary 引入回放一致性测试框架,用于验证会话历史、内存记录和摘要内容在不同存储后端、不同 replay 场景下是否保持稳定、可解释、可审计。
完成内容
in_memory和sqlite两类后端覆盖场景
当前样例覆盖:
主要文件
tests/sessions/test_replay_consistency.py:replay consistency 测试主逻辑,包含后端参数化、diff 分类、断言、性能和误报率检查tests/sessions/replay_cases/session_memory_summary_replay_cases.jsonl:18 条公开 replay 样例,可继续追加扩展session_memory_summary_diff_report.json:当前样例的结构化回放报告,记录 coverage、case 结果、diff 详情和错误统计docs/mkdocs/zh/session_replay_consistency.md:中文设计说明,解释 replay 目标、报告结构、扩展方式和限制验收映射
in_memory和sqlitesession_memory_summary_diff_report.json报告结果摘要
当前
session_memory_summary_diff_report.json显示:case_count: 18backend_error_count: 0normal_diff_count: 0normal_false_positive_rate: 0.0mode.lightweight: truein_memory,sqlitein_memory,sqlite本地验证
本地结果:
tests/sessions/test_replay_consistency.py:64 passedgit diff --check:通过session_memory_summary_diff_report.json:JSON 格式合法设计边界
本次实现是提供一致性测试和审计能力,不改变默认运行时行为。对于依赖模型生成内容的场景,使用 lightweight replay mode 固定可比较输出,重点验证Session / Memory / Summary 状态流转、存储读写和报告生成是否稳定。